package IOStreamStudy.properties;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * 对properties的基本写入操作
 * */

public class PropertiesWriteDemo {

    public static void main(String[] args) throws IOException {
        String filePath = "D:\\all_projects\\java_projects\\java_ij\\springMVC\\NetWork\\src\\cn\\usts\\edu" +
                "\\IOStreamStudy\\properties\\mysqlWrite.properties";

        Properties properties = new Properties();
        properties.setProperty("usr","root");
        properties.setProperty("psd","456");
        properties.setProperty("ip","192.168.1.1");

        properties.store(new FileOutputStream(filePath),"数据库配置信息");//comments - 属性列表的描述。中文会转换成Unicode编码

    }
}
